package com.borrowed.book.coupon.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.borrowed.book.book.domain.SCouponDto;
import com.borrowed.book.book.domain.SelectUserCouponInDto;
import com.borrowed.book.coupon.entity.SCoupon;
import com.borrowed.book.system.domain.AjaxResult;
import com.borrowed.book.system.exception.CommonException;

import java.util.Date;
import java.util.List;

/**
*优惠券服务
*/
public interface SCouponService extends IService<SCoupon> {

    /**
     * 新增优惠券
     * @param coupon
     * @return
     * @throws CommonException
     */
    public boolean addCoupon(SCoupon coupon) throws CommonException;

    /**
     * 修改优惠券
     * @param coupon
     * @return
     * @throws CommonException
     */
    public boolean updateCoupon(SCoupon coupon) throws CommonException;
    /**
     * 删除优惠券
     * @param id
     * @return
     */
    public boolean   deleteCoupon(Long id) throws Exception;
    /**
     * 新人用户自动创建优惠券
     * @param openid
     */
    public void createNewuserCoupon(String openid);
    /**
     * 购买会员给用户创建快递优惠券
     */
    public void createMemberCardExpressCoupon(Date endTime, String openid, Integer number);
    /**
     * 小程序端根据用户查询优惠券
     */
    public List<SCouponDto> selectUserCoupon(SelectUserCouponInDto param);

}
